package task06_04;

import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;

/**
 * Create by IntelliJ IDEA
 *
 * @author: jsonor
 * @date-Time: 2018/5/4 8:17
 * @description:
 */
public class CopyMP4 {

  public static void main(String[] args) {
    BufferedInputStream bufferedInputStream=null;
    BufferedOutputStream bufferedOutputStream=null;
    try{
       bufferedInputStream=new BufferedInputStream(new FileInputStream("1.mp4"));
       bufferedOutputStream=new BufferedOutputStream(new FileOutputStream("c:\\美女"));
       byte[] bytes=new byte[1024];
       int len=0;
       while((len=bufferedInputStream.read(bytes))!=-1){
         bufferedOutputStream.write(bytes,0,len);
       }
    }catch (Exception e){
      System.out.println(e.getMessage());
    }finally {
      if(bufferedInputStream!=null){
        try {
          bufferedInputStream.close();
        } catch (IOException e) {
          e.printStackTrace();
        }
      }
      if(bufferedOutputStream!=null){
        try {
          bufferedOutputStream.close();
        } catch (IOException e) {
          e.printStackTrace();
        }
      }


    }
  }

}
